<template>
	<view>
		<web-view :src="url"></web-view>
	</view>
</template>

<script>
	let _self
	export default {
		data() {
			return {
				url: "",
				time: "",
			}
		},
		onLoad: function(option) {
			this.url = option.url;
			this.time = option.time;
		},

		onBackPress() {
			this.getNewTimeGe()
		},
		methods: {
			getNewTimeGe() {
				_self = this;
				var oDate2 = new Date();
				var dateDiff = oDate2.getTime() - this.time;
				var s = dateDiff / 1000; // 毫秒转为秒
				var minute = Math.floor(s / 60); //分
				if(minute  == 0){
					minute = 1;
				}
				_self.$$.request({
					url: _self.config.getNewTimeGe,
					data: {
						minutes:minute
					},
					method: "POST"
				}, false, true).then((res) => {
					console.log("res",res)
				}).catch((Error) => {
					console.log(Error.msg)
				}).finally(() => {
					console.log("complete")
				})
			}
		}
	}
</script>

<style>

</style>
